

use crate::math::{ Vector3f, Vector2f};
use crate::color::Rgba;
use crate::pool::Handle;

use super::texture::{Texture, Sampler};


#[derive(Debug)]
/// 材质
pub struct Material {
    /// 材质存储的路径 
    /// TODO 
    path:       String,
    /// 纹理贴图
    texture:    Handle<Texture>,
    /// 贴图采样器
    sampler:    Handle<Sampler>,
    /// 材质颜色
    color:      Rgba,
    /// 材质的反射度
    specular:   Vector3f,
    /// 材质的光滑度
    shininess:  f32,
    /// 材质的纹理贴图平铺
    factory:    Vector2f,
    // /// 材质的 GPU 绑定组
    // gpu_group:  wgpu::BindGroup
}

impl Default for Material {
    fn default() -> Self {
        Self {
            path:       String::from(""),
            texture:    Handle::try_get_default_handle(),
            sampler:    Handle::try_get_default_handle(),
            color:      Rgba::WHITE,
            specular:   Vector3f::new(0.5, 0.5, 0.5),
            shininess:  32.0,
            factory:    Vector2f::new(1.0, 1.0),
        }
    }
}